$(function () {
    $.ajax({
        url: "../static/json/kidslist.json",
        success: function (res) {
            render(res.goods3)
            // console.log(res.goods3);
        }
    })
    function render(res) {
        var box = $(".Kids-popularity-box")
        for(var i = 0;i<$(".goods-item").length;i++){

        
       box.html(
           res.map(item => `
           <div class="goods-item">
            <div class="goods-img">
                <a>
                    <img src="${item.img}" alt="">
                </a>
                <div class="goods-bar">
                    <img src="${item.barimg}" alt="">
                    <div class="tag-price">
                            <span>￥</span>${item.tagPrice}
                    </div>
                </div>
            </div>
            <div class="goods-info-box">
                    <div class="brand-box">
                        <a href="" class="brand-name" target="_blank">${item.name}</a> 
                        <span class="discount">${item.discount}</span>
                    </div> 
                    <a href="" target="_blank" class="goods-name">${item.title}</a> 
                    <div class="price-box">
                        <span class="sale-price">${item.salePrice}</span> 
                        <span class="market-price">${item.marketPrice}</span>
                    </div>
            </div> 
            </div>     
                `).join("")
               
        )
    }
}
})